package chapters.appenders.db;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by YLC on 2017/11/9 0009.
 */
public class DBAppenderTest {
    public static void main(String[] args) throws JoranException {
        String configFile = "src/main/java/chapters/appenders/db/append-toMySQL-with-driverManager.xml";
        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        JoranConfigurator configurator = new JoranConfigurator();
        lc.stop();
        configurator.setContext(lc);
        configurator.doConfigure(configFile);

        Logger logger = LoggerFactory.getLogger(DBAppenderTest.class);
        logger.info("this is a text.");
    }
}
